title = ">CASP3\n"
seqs = "MENTENSVDSKSIKNLEPKIIHGSESMDSGISLDNSYKMDYPEMGLCIIINNKNFHKSTGMTSRSGTDVDAANLRETFRNLKYEVRNKNDLTREEIVELMRDVSKEDHSKRSSFVCVLLSHGEEGIIFGTNGPVDLKKITNFFRGDRCRSLTGKPKLFIIQACRGTELDCGIETDSGVDDDMACHKIPVEADFLYAYSTAPGYYSWRNSKDGSWFIQSLCAMLKQYADKLEFMHILTRVNRKVATEFESFSFDATFHAKKQIPCIVSMLTKELYFYH\n"

import os

#创建自动运行文件

file_names = os.listdir('./')
#print(file_names)
dir_list = []

for i in file_names:
    dir_list.append(i)

print(dir_list)

for i in dir_list:
    if i[-5:-1]+i[-1] == "fasta":
        f= open(i,"r")
        lines = [i for i in f]
        f.close()
        # lines[1] = lines[1] + "\n"
        lines.append(title)
        lines.append(seqs)
        print(lines)
        fs = open(i,"w+")
        fs.writelines(lines)
        fs.close()




